/**
 * Created with IntelliJ IDEA.
 * Description:
 */
import java.util.Arrays;
import java.util.Scanner;
public class TestDemo {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = scanner.nextInt();
        }
        System.out.println(Arrays.toString(arr));

        //write your code here......
        int i = 0;
        int j = arr.length-1;
        while(i < j){
            int tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
            i++;
            j--;
        }

        System.out.println(Arrays.toString(arr));
    }
}
